<template name="kongyemian">
	<view>
		<view class="imgbox">
			<image src="../static/kong.png" mode=""></image>
			<text class="big">您还没有加入学校</text>
			<text class="xiaozi">无法接收老师或者学校发布的公告，通知消息 请咨询老师或者校领导!</text>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from 'vuex';
	export default {
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo,				
				isLogin: state => state.user.isLogin
			})
		},
		name: "kongyemian",
		data() {
			return {

			};
		},
		methods:{
			showcode(token) { //微信登录的接口
				this.$store
					.dispatch('apiUserAutoLogin', {
						token: token
					})
					.then(res => {
						console.log(res)
						if (this.userInfo.if_bangd == 1) {
							uni.reLaunch({
								url:'../../pages/index/index'
							})
						} 
					});
			
			},
		},
		onLoad() {
			if (uni.getStorageSync("token")) { //判断是否有token，然后调用自动登录的接口
				this.$store
					.dispatch('loginByWexin')
					.then(res => {
						this.code = res
						this.showcode(uni.getStorageSync("token")) //自动登录的接口
					});
			} else { //没有token，去登录页面点击登录					
			}
		}
		
	}
</script>

<style lang="less">
	.imgbox {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translateX(-50%) translateY(-50%);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		text-align: center;
		image {
			width: 400rpx;
			height: 400rpx;
			margin-bottom: 8rpx;			
		}

		.big {
			color: #000;
			font-size: 35rpx;
			font-weight: bold;
			margin-top: -40rpx;
			
		}
		.xiaozi{
			margin-top: 15rpx;
			font-size: 26rpx;
			color: #4e4e4e;
		}
	}
</style>
